<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/5/23
 * Time: 13:33
 */
include_once 'class/Http.php';
$config= include('class/config.php');

//$redis = new \think\cache\driver\Redis($config['redis']);
//$db = new \think\Db($config['db']);
$http = new Http();
$genderList=[1,2];
$baseUrl="47.56.207.234/v3/find/index?gender=";
foreach ($genderList as $v){
    $url = $baseUrl.$v;
    $list = $http::curlPost($url);
    $list = json_decode($list,true);
    if($list['status'] == 0 && !empty($list['data']['cs'])){
        $dataList = $list['data']['cs'];
        foreach ($dataList as $cate){
            file_put_contents("data/catelist.csv",json_encode($cate,258).PHP_EOL,FILE_APPEND);
        }
    }
}


